package com.qf.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.event.util.EventUtil;
import com.qf.dao.RoomPriceDao;
import com.qf.entity.RoomPrice;
import com.qf.service.RoomPriceService;
import com.qf.util.EventTypeContact;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * (RoomPrice)表服务实现类
 *
 * @author makejava
 * @since 2020-09-15 15:56:14
 */
@Service("roomPriceService")
public class RoomPriceServiceImpl extends ServiceImpl<RoomPriceDao, RoomPrice> implements RoomPriceService {

    @Autowired
    private EventUtil eventUtil;

    @Override
    public boolean updateById(RoomPrice entity) {
        //修改数据库的价格
        super.updateById(entity);

        //发布酒店价格修改事件
        eventUtil.sendMsg(EventTypeContact.UPDATE_PRICE, entity);
        return true;
    }
}